﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Support.Entities;
using DataAccess;
using Support.Exceptions;

namespace Business
{
    public class Department : IDepartment
    {

        #region Properties

        public string Name { get; set; }

        public int Id { get; set; }

        #endregion


        public IList<IDepartment> GetDepartments()
        {
            DepartmentDAL departmentDAL = new DepartmentDAL();
            try
            {
                return departmentDAL.GetDepartments();
            }
            catch (Exception ex)
            {
                throw new BusinessException(string.Format("Error al cargar los departamentos"), ex);
            }
        }
    }
}
